import { defineStore } from 'pinia'
import { ref } from 'vue'
import { getCategoryApi } from '@/api/init'

export const useCategoryStore = defineStore('category', () => {
  // states
  const categoryList = ref([])

  // actions
  const getCategoryToStore = async () => {
    const res = await getCategoryApi()
    categoryList.value = res.result
  }

  return {
    categoryList,
    getCategoryToStore
  }
})
